package com.itheima.a14waitandnotify;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends Thread {

    ArrayBlockingQueue<String> foodieQueue;

    public Foodie(ArrayBlockingQueue<String> foodieQueue) {
        this.foodieQueue = foodieQueue;
    }

    public void run() {
        while(true ) {
            //放面条
            try {
                foodieQueue.put("面条") ;
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("放一碗面条");
        }
    }
}
